package zjh_20230314;

import java.util.*;

public class Demo02 {
    public static void main(String[] args) {
        List<Account> list = new ArrayList<>();
        list.add(new Account(10.00, "1234"));
        list.add(new Account(15.00, "5678"));
        list.add(new Account(0, "1010"));
        Map<Long, Account> map = new HashMap<>();
//s
        for (Account obj :
                list) {
             map.put(obj.getId(),obj);
        }

        for (Map.Entry<Long,Account> m :
                map.entrySet()) {
            Long key = m.getKey();
            Account a = m.getValue();
            System.out.println("key:" + key + ", Account 对象" + a);
            
        }

        System.out.println(list.toString());
    }
}
